Skip to content

mshv: mount nvme resource disk for VM image copies#4434

Merged
LiliDeng merged 1 commit intomainfrom
anrayabh/mshv_stress_vm_create_resource_disk
Apr 29, 2026
Merged

mshv: mount nvme resource disk for VM image copies#4434
LiliDeng merged 1 commit intomainfrom
anrayabh/mshv_stress_vm_create_resource_disk

Conversation

@anirudhrb
Copy link
Copy Markdown
Collaborator

The previous logic in MshvHostStressTestSuite._get_disk_img_copy_path treated existence of /mnt as proof that a large resource disk was mounted there. On NVMe-based Azure SKUs the temporary disks show up as /dev/nvme*n1 and are not mounted anywhere, so the test ended up copying many large guest images onto the small OS disk and ran out of space.

Use lsblk to detect what is actually mounted at /mnt/resource and /mnt and reuse those when present. Otherwise pick an unused nvme*n1 disk (not the OS disk, no partitions, nothing mounted), format it as ext4, and mount it at /mnt/resource. Fall back to the working path if no suitable disk is found or the mount fails.

Description

Related Issue

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation update

Checklist

  • Description is filled in above
  • No credentials, secrets, or internal details are included
  • Peer review requested (if not, add required peer reviewers after raising PR)
  • Tests executed and results posted below

Test Validation

Key Test Cases:

Impacted LISA Features:

Tested Azure Marketplace Images:

Test Results

Image VM Size Result
PASSED / FAILED / SKIPPED

Copilot AI review requested due to automatic review settings April 24, 2026 10:46
@github-actions
Copy link
Copy Markdown

🤖 AI Test Selection

No test cases were selected for this PR.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the MSHV host stress test to avoid copying many large guest disk images onto the OS disk on NVMe-based Azure SKUs by detecting whether /mnt/resource or /mnt are actually backed by a mounted disk, and (when neither is mounted) attempting to format+mount an unused nvme*n1 disk at /mnt/resource for disk image copies.

Changes:

  • Replace the prior “/mnt directory exists” heuristic with lsblk-based mountpoint detection for /mnt/resource and /mnt.
  • Add logic to select an unused NVMe namespace disk and mount it as ext4 at /mnt/resource to host VM disk image copies, with fallback to the node working path.
  • Add helper methods for mountpoint detection and NVMe disk selection.

Comment thread lisa/microsoft/testsuites/mshv/mshv_root_stress_tests.py
Comment thread lisa/microsoft/testsuites/mshv/mshv_root_stress_tests.py
Comment thread lisa/microsoft/testsuites/mshv/mshv_root_stress_tests.py
Comment thread lisa/microsoft/testsuites/mshv/mshv_root_stress_tests.py Outdated
The previous logic in MshvHostStressTestSuite._get_disk_img_copy_path
treated existence of /mnt as proof that a large resource disk was
mounted there. On NVMe-based Azure SKUs the temporary disks show up as
/dev/nvme*n1 and are not mounted anywhere, so the test ended up copying
many large guest images onto the small OS disk and ran out of space.

Use lsblk to detect what is actually mounted at /mnt/resource and /mnt
and reuse those when present. Otherwise pick an unused nvme*n1 disk
(not the OS disk, no partitions, nothing mounted), format it as ext4,
and mount it at /mnt/resource. Fall back to the working path if no
suitable disk is found or the mount fails.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
@anirudhrb anirudhrb force-pushed the anrayabh/mshv_stress_vm_create_resource_disk branch from 89c06b4 to a973479 Compare April 28, 2026 13:30
@github-actions
Copy link
Copy Markdown

🤖 AI Test Selection

No test cases were selected for this PR.

@LiliDeng LiliDeng merged commit 64340b8 into main Apr 29, 2026
61 checks passed
@LiliDeng LiliDeng deleted the anrayabh/mshv_stress_vm_create_resource_disk branch April 29, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants